
module Stalking
  class Handlers
    attr_reader :before_handlers, :after_handlers, :error_handlers, :job_handlers

    def initialize
      @before_handlers = []
      @after_handlers = []
      @error_handlers = []

      @job_handlers = {}
    end

    def before(&block)
      @before_handlers.push block
    end

    def after(&block)
      @after_handlers.push block
    end

    def error(&block)
      @error_handlers.push block
    end

    def job(name, &block)
      @job_handlers[name] = block
    end
  end
end

